package cn.getech.data.metadata.mapper;

import cn.getech.data.metadata.entity.meta.CollectionTableField;
import cn.getech.data.metadata.entity.meta.CollectionTableFieldExample;
import cn.getech.data.metadata.entity.permission.TreeData;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Set;

@Mapper
public interface CollectionTableFieldMapper extends BaseMapper<CollectionTableField> {
    long countByExample(CollectionTableFieldExample example);

    int deleteByExample(CollectionTableFieldExample example);

    List<CollectionTableField> selectByExample(CollectionTableFieldExample example);

    int updateByExampleSelective(@Param("record") CollectionTableField record, @Param("example") CollectionTableFieldExample example);

    int updateByExample(@Param("record") CollectionTableField record, @Param("example") CollectionTableFieldExample example);

    int updateBatch(List<CollectionTableField> list);

    int batchInsert(@Param("list") List<CollectionTableField> list);

    int insertOrUpdate(CollectionTableField record);

    int insertOrUpdateSelective(CollectionTableField record);

    int removeBatchIds(@Param("ids") List<Integer> list);

    String[] selectFieldType();

    List<Integer> selectHavePermissionFields(@Param("userId") Long userId);

    List<CollectionTableField> selectListByTableIds(@Param("tableIds")  Set<Integer> tableIds);

    //查询目录负责人
    Integer selectUserByTableId(@Param("id") Integer id);

    List<TreeData> listDataAssetsCategory();

}